Skip to content

PLAT-2003/ci: relock uv.lock on version bump - #48

Merged
brtkwr merged 1 commit into
mainfrom
PLAT-2003/bumpver-relock-hook
Jul 30, 2026
Merged

PLAT-2003/ci: relock uv.lock on version bump#48
brtkwr merged 1 commit into
mainfrom
PLAT-2003/bumpver-relock-hook

Conversation

@brtkwr

@brtkwr brtkwr commented Jul 29, 2026

Copy link
Copy Markdown
Member

Context

bumpver rewrites the version in pyproject.toml but not in uv.lock, so every release quietly desynced the two. That went unnoticed because nothing checked — until the uv-lock pre-commit hook landed (PLAT-2003), which now catches it as a red pre-commit on the next PR.

Six repos had already drifted this way; ratatosk's lock was three releases behind its pyproject. The repos that never drifted all turned out to have one thing in common: a pre_commit_hook on [tool.bumpver] that regenerates the lock as part of the bump commit. Correlation was exact — 10/10 repos with the hook in sync, 6/6 without it drifted.

Changes

  • Add bin/bumpver-hook.sh (mode 100755) and wire it up as pre_commit_hook in [tool.bumpver], so the bump commit carries the regenerated lock:
#!/bin/bash
set -e
uv lock --no-upgrade
git add uv.lock

Scope / Non-goals

  • --no-upgrade is deliberate and load-bearing. It reconciles the lock to pyproject.toml without pulling newer versions of anything else. A bare uv lock here would re-resolve everything and sweep in every dependency upgrade dependabot had written into pyproject but never locked — which is precisely how ratatosk picked up pydantic 2.13.4 and lost staging for a week (PLAT-2000).
  • No dependency versions change in this PR. It only affects what future bump commits do.
  • Existing lock drift, where present, is fixed separately — this stops the bleeding rather than backfilling.

Validation

  • Matches the bin/bumpver-hook.sh already in use in auth-gateway, buyer-portal-service, card-issuing, checkout-api, fastapi-app-template, merchant-onboarding-service, njord-bank, orders and risk-engine.
  • Script committed via the git data API so the 100755 exec bit is preserved.

Ticket

🤖 Generated with Claude Code

https://claude.ai/code/session_017VDJqb1XWoNNxZEfGQ8meH

bumpver rewrites the version in pyproject.toml but not in uv.lock, so every
release desynced the two. With the uv-lock pre-commit hook now in place that
surfaces as a red pre-commit on the next PR.

Add the pre_commit_hook the other repos already use, so the bump commit
carries the regenerated lock. `--no-upgrade` is deliberate: it reconciles the
lock to pyproject without pulling newer versions of anything else. A bare
`uv lock` here would sweep in every deferred dependabot upgrade at bump time,
which is how ratatosk ended up with pydantic 2.13.4 (PLAT-2000).
@github-actions

Copy link
Copy Markdown

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
253 244 96% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: ab74a06 by action🐍

@Puvendhan Puvendhan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PLAT-2003 round 2. Verified config-only: no dependency-version upgrades (checked the uv.lock diffs — only each repo's own project version relocks + payload-encryption's keyring cleanup). Approving.

@brtkwr
brtkwr merged commit 4b6d757 into main Jul 30, 2026
1 check passed
@brtkwr
brtkwr deleted the PLAT-2003/bumpver-relock-hook branch July 30, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants